<?php
require_once(Kohana::find_file('vendor','phprpc/phprpc_client'));
/**
 * Created by PhpStorm.
 * User: yuqing
 * Date: 16-4-5
 * Time: 下午11:56
 */
class Hznewerpclient{
//    const SERVER_IP = 'http://127.0.0.1:703/commonapi/newerpapi/';
    const SERVER_IP = 'http://192.168.5.6:703/commonapi/newerpapi/';
    public static function getClient($uri){
        $address = self::SERVER_IP.$uri;
        $client = new PHPRPC_Client();
        $client->useService($address);
        return $client;
    }
    public static function getWarehouses($skuArr = array()){
        $client = self::getClient('getSkuMainWarehouses');
        return $client->getData($skuArr);
    }

    /**
     * 其它入库获取最新的采购入库单价
     */
    public static function getNewPrice($skuArr = array()){
        $client = self::getClient('getNewPrice');
        return $client->getData($skuArr);
    }
}